package com.lau.common.exception;

import com.lau.common.enums.ResultStatusEnum;
import lombok.Getter;

/**
*@author:Lau
*@create: 2023-12-08 13:36
*@Description: 公共异常类
*/
@Getter
public class DebugException extends RuntimeException{
    private final int code;
    private final String msg;
    public DebugException(String msg) {
        super(msg);
        this.code = ResultStatusEnum.FAILURE.getCode();
        this.msg = msg;
    }
    public DebugException(int code,String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public DebugException(ResultStatusEnum result) {
        super(result.getMsg());
        this.code = result.getCode();
        this.msg = result.getMsg();
    }
}
